<!--
 * @Author: 29340 2934022986@qq.com
 * @Date: 2025-04-07 14:28:29
 * @LastEditors: 29340 2934022986@qq.com
 * @LastEditTime: 2025-04-07 14:57:17
 * @FilePath: \Exam system\src\views\Audit.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="audit-page">
    <h2>内容审核</h2>
    <div v-for="item in pendingItems" :key="item.id" class="audit-item">
      <p>{{ item.content }}</p>
      <div class="audit-actions">
        <el-button type="success" @click="approve(item.id)">通过</el-button>
        <el-button type="danger" @click="reject(item.id)">拒绝</el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const pendingItems = ref([
  { id: 1, content: '课程《人工智能基础》申请上线' },
  { id: 2, content: '用户「李老师」权限升级申请' }
])

const approve = (id) => {
  pendingItems.value = pendingItems.value.filter(item => item.id !== id)
}

const reject = (id) => {
  pendingItems.value = pendingItems.value.filter(item => item.id !== id)
}
</script>

<style scoped>
.audit-page {
  padding: 20px;
}

.audit-item {
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 10px;
}

.audit-actions {
  margin-top: 10px;
}
</style>